From 63e8667404593bc52b20f9f56cbadfcafc4c00fc Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Fri, 28 May 2010 09:25:07 +0100 Subject: [PATCH] xl: Combine headers into one header file. This provides a single place to put declarations of external symbols etc. Signed-off-by: Ian Jackson --- tools/libxl/xl.c | 3 +-- tools/libxl/{xl_cmdimpl.h => xl.h} | 17 +++++++++++++--- tools/libxl/xl_cmdimpl.c | 2 +- tools/libxl/xl_cmdtable.c | 2 +- tools/libxl/xl_cmdtable.h | 31 ------------------------------ 5 files changed, 17 insertions(+), 38 deletions(-) rename tools/libxl/{xl_cmdimpl.h => xl.h} (90%) delete mode 100644 tools/libxl/xl_cmdtable.h diff --git a/tools/libxl/xl.c b/tools/libxl/xl.c index a01bf38658..82ab873a43 100644 --- a/tools/libxl/xl.c +++ b/tools/libxl/xl.c @@ -29,8 +29,7 @@ #include "libxl.h" #include "libxl_utils.h" -#include "xl_cmdimpl.h" -#include "xl_cmdtable.h" +#include "xl.h" extern struct libxl_ctx ctx; extern int logfile; diff --git a/tools/libxl/xl_cmdimpl.h b/tools/libxl/xl.h similarity index 90% rename from tools/libxl/xl_cmdimpl.h rename to tools/libxl/xl.h index e6b4c3beb3..faf784ae8b 100644 --- a/tools/libxl/xl_cmdimpl.h +++ b/tools/libxl/xl.h @@ -12,8 +12,16 @@ * GNU Lesser General Public License for more details. */ -#ifndef XL_CMDIMPL_H -#define XL_CMDIMPL_H +#ifndef XL_H +#define XL_H + +struct cmd_spec { + char *cmd_name; + int (*cmd_impl)(int argc, char **argv); + char *cmd_desc; + char *cmd_usage; + char *cmd_option; +}; int main_vcpulist(int argc, char **argv); int main_info(int argc, char **argv); @@ -63,4 +71,7 @@ int main_tmem_shared_auth(int argc, char **argv); void help(char *command); -#endif /* XL_CMDIMPL_H */ +extern struct cmd_spec cmd_table[]; +extern int cmdtable_len; + +#endif /* XL_H */ diff --git a/tools/libxl/xl_cmdimpl.c b/tools/libxl/xl_cmdimpl.c index 59194b61ea..c7f6f8fe2d 100644 --- a/tools/libxl/xl_cmdimpl.c +++ b/tools/libxl/xl_cmdimpl.c @@ -38,7 +38,7 @@ #include "libxl.h" #include "libxl_utils.h" #include "libxlutil.h" -#include "xl_cmdtable.h" +#include "xl.h" #define UUID_FMT "%02hhx%02hhx%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx-%02hhx%02hhx%02hhx%02hhx%02hhx%02hhx" diff --git a/tools/libxl/xl_cmdtable.c b/tools/libxl/xl_cmdtable.c index feda1f9c92..accc4f929b 100644 --- a/tools/libxl/xl_cmdtable.c +++ b/tools/libxl/xl_cmdtable.c @@ -12,7 +12,7 @@ * GNU Lesser General Public License for more details. */ -#include "xl_cmdtable.h" +#include "xl.h" struct cmd_spec cmd_table[] = { { "create", diff --git a/tools/libxl/xl_cmdtable.h b/tools/libxl/xl_cmdtable.h deleted file mode 100644 index 90d1058e8e..0000000000 --- a/tools/libxl/xl_cmdtable.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Author Yang Hongyang - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License as published - * by the Free Software Foundation; version 2.1 only. with the special - * exception on linking described in file LICENSE. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - */ - -#ifndef XL_CMDTABLE_H -#define XL_CMDTABLE_H - -#include "xl_cmdimpl.h" - -struct cmd_spec { - char *cmd_name; - int (*cmd_impl)(int argc, char **argv); - char *cmd_desc; - char *cmd_usage; - char *cmd_option; -}; - -extern struct cmd_spec cmd_table[]; -extern int cmdtable_len; - -#endif /* XL_CMDTABLE_H */ -- 2.30.2